import 'package:flutter_app_study/bean/serial_number_entity.dart';

serialNumberEntityFromJson(SerialNumberEntity data, Map<String, dynamic> json) {
	if (json['data'] != null) {
		data.data = new List<SerialNumberData>();
		(json['data'] as List).forEach((v) {
			data.data.add(new SerialNumberData().fromJson(v));
		});
	}
	return data;
}

Map<String, dynamic> serialNumberEntityToJson(SerialNumberEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	if (entity.data != null) {
		data['data'] =  entity.data.map((v) => v.toJson()).toList();
	}
	return data;
}

serialNumberDataFromJson(SerialNumberData data, Map<String, dynamic> json) {
	if (json['type'] != null) {
		data.type = json['type']?.toString();
	}
	if (json['content'] != null) {
		data.content = json['content']?.toString();
	}
	return data;
}

Map<String, dynamic> serialNumberDataToJson(SerialNumberData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['type'] = entity.type;
	data['content'] = entity.content;
	return data;
}